const { resolve } = require('path')
const htmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  mode: 'development',
  entry: resolve(__dirname, 'src/main.js'),
  output: {
    filename: 'bundle.js',
    path: resolve(__dirname, 'dist')
  },
  devtool: 'source-map',
  resolve: {
    extensions: ['.js', '.vue', '.ts']
  },
  resolveLoader: {
    modules: [
      'node_modules',
      resolve(__dirname, './my-modules')
    ]
  },
  module: {
    rules: [
      {
        test: /.vue$/i,
        loader: 'vue-loader'
      },
      {
        test: /.css$/i,
        use: ['style-loader', 'css-loader']
      }
    ]
  },
  plugins: [
    new htmlWebpackPlugin({
      template: resolve(__dirname, 'public/index.html')
    })
  ]
}